﻿/*******************************************************************
This file is part of WP7DropBox.

WP7DropBox is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

WP7DropBox is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with WP7DropBox.  If not, see <http://www.gnu.org/licenses/>.
*******************************************************************/

namespace l3v5y.Dropbox
{
    using System;
    public enum DropboxStatusCode
    {
        UserOverQuota = 507,
        BadToken = 401,
        BadOAuth = 403,
        PathNotFound = 404,
        NotChanged = 304,
        BadInput = 400,
        NotExpectedMethod = 405,
    }
    public class DropboxError : Exception
    {
        private DropboxStatusCode m_errorcode = 0;
        public DropboxStatusCode ErrorCode
        {
            get
            {
                return m_errorcode;
            }
        }
        private string m_errormsg = "";
        public string ErrorMessage
        {
            get
            {
                return m_errormsg;
            }
        }
        public DropboxError(DropboxStatusCode errorcode)
            : base()
        {
            m_errorcode = errorcode;
        }
        public DropboxError(DropboxStatusCode errorcode, string message)
            : base(message)
        {
            m_errorcode = errorcode;
            m_errormsg = message;
        }
    }
}
